﻿using System;
using System.ServiceModel;

namespace ExplorerService.Common.ServiceContracts
{
    /// <summary>
    /// Service used by clients to monitor application sessions
    /// </summary>
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IApplicationMonitorServiceCallback))]
    public interface IApplicationMonitorService
    {
        /// <summary>
        /// Starts the monitor for a client session
        /// </summary>
        /// <param name="sessionId">The ID of the client session</param>
        [OperationContract(IsInitiating = true, IsTerminating = false)]
        void StartMonitor(Guid sessionId);

        /// <summary>
        /// Pings the service to make sure the it's still alive
        /// </summary>
        /// <returns></returns>
        [OperationContract(IsInitiating = false, IsTerminating = false)]
        bool Ping();


        /// <summary>
        /// Stops the monitor and closes the service session
        /// </summary>
        [OperationContract(IsInitiating = false, IsTerminating = true)]
        void EndMonitor();
    }
}
